import request from '@/utils/request'
const module = '/admin/product/categoryBrand'
//查询分类下的所有品牌
export const GetBrandsByCategoryId = categoryId => {
  return request({
    url: `${module}/listBrands/${categoryId}`,
    method: 'get',
  })
}
// 条件查询分类品牌列表数据
export const GetCategoryBrands = (pageNum, pageSize, searchObj) => {
  return request({
    url: `${module}/list/${pageNum}/${pageSize}`,
    method: 'get',
    params: searchObj,
  })
}

//删除指定分类品牌
export const DeleteCategoryBrandById = id => {
  return request({
    url: `${module}/deleteById/${id}`,
    method: 'DELETE',
  })
}
//新增分类品牌
export const SaveCategoryBrand = categoryBrand => {
  return request({
    url: `${module}/save`,
    method: 'POST',
    data: categoryBrand,
  })
}
//查询指定分类品牌
export const GetCategoryBrandById = id => {
  return request({
    url: `${module}/getById/${id}`,
    method: 'GET',
  })
}
//更新分类品牌
export const UpdateCategoryBrand = categoryBrand => {
  return request({
    url: `${module}/update`,
    method: 'PUT',
    data: categoryBrand,
  })
}
